/*
 * @(#)DateUtils.java    Jul 6, 2010
 *
 * Copyright 2009 Nyber Shanghai, Inc. All rights reserved.
 */

package com.lab.lang;

import org.joda.time.DateTime;

/**
 * Class description goes here.
 *
 * @author nickevin@gmail.com
 * @version Jul 6, 2010 3:07:41 PM
 */

public class DateUtils {

	public static final String DELIMITER = "-";

	public static final String YEAR = "yyyy";
	public static final String MONTH = "MM";
	public static final String DAY = "dd";
	public static final String DATE_DEFAULT = YEAR + DELIMITER + MONTH
			+ DELIMITER + DAY;
	public static final String TIME_DEFAULT = "yyyy-MM-dd HH:mm:ss";
	public static final String DATA_YYYYMMDD = "yyyyMMdd";
	public static final String TIME_HHMMSS = "HH:mm:ss";

	public static final int ONE_SECOND = 1000;
	public static final int ONE_MINUTE = 60 * ONE_SECOND;
	public static final int ONE_HOUR = 60 * ONE_MINUTE;
	public static final long ONE_DAY = 24 * ONE_HOUR;

	private DateUtils() {}

	public static String toString(String format) {
		return new DateTime().toString(format);
	}

	public static String currentYear() {
		return toString(YEAR);
	}

	public static String currentMonth() {
		return toString(MONTH);
	}

	public static String currentDay() {
		return toString(DAY);
	}

	public static String currentDate() {
		return toString(DATE_DEFAULT);
	}

	public static String currentTime() {
		return toString(TIME_DEFAULT);
	}

}
